Tutorial 3 - Examples in Singular Value Decomposition

Assignment 1

Using the file dl-matrixmarket.jl from the package MatrixMarket.jl (copy the file to your notebook), download two randomly chosen matrices.

For each matrix:

  • inspect the properties of the matrix (size, symmetry, condition number, sparsity, structure, scaled condition number, ...),
  • plot the matrix using the command spy() from the package Gadfly.jl,
  • compute the singular value decomposition, and
  • assess its accuracy.

Hints

  1. In Windows, you may need to prepend the http:// to the address in the download() command.

  2. To plot the matrix A, use the following commands:

    myplot=spy(A)
    draw(PNG(12cm,12cm),myplot)

    To see only the structure, use

    myplot=spy(map(Int64,A.!=0.0))

    For larger matrices, plotting takes a while.

Assignment 2

Choose an image from the package TestImages.jl or find an image elsewhere.

Compute low-rank aproximations of the image and display them using @manipulate.

Assignment 3

Write a wrapper for DGESVJ similar to those from the file lapack.jl.

Test the function on a strongly scaled matrix.

For larger matrices, compare timings with svd().


In [ ]: